[dead-code] Skip substr casting removal on PHP 7.x, as can return false|string#7449
[dead-code] Skip substr casting removal on PHP 7.x, as can return false|string#7449TomasVotruba merged 2 commits intomainfrom
Conversation
| return false; | ||
| } | ||
|
|
||
| return ! $this->phpVersionProvider->isAtLeastPhpVersion(PhpVersion::PHP_80); |
There was a problem hiding this comment.
PHPStan already detect it clearly when run on php 7.x
see https://phpstan.org/r/853f59a6-22ad-48ac-af93-66606b569613
on PHP 7.2 - 7.4 tab.
There was a problem hiding this comment.
But not on PHP 8.0+. This also allow to add our test with PHP 7.4 version.
465b05d to
fc45da9
Compare
| */ | ||
| $subClassName = (string) substr( | ||
|
|
||
| $subClassName = substr( |
There was a problem hiding this comment.
this cast is needed here as downgrade rule is not yet created.
There was a problem hiding this comment.
This should be fixed with incorrect input instead. This structure is clearly wrong.
There was a problem hiding this comment.
Ok, I will create separate PR target your branch for different logic to handle this.
There was a problem hiding this comment.
Great 👍 We'll need to understand what values are going in any why it returns false.
It should be fixed to return always string instead
fc45da9 to
0b21f6c
Compare
|
This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work. |
No description provided.